import VueRouter from 'vue-router'
import Vue from 'vue' 
import register from '../view/register.vue'
import login from '../view/login.vue'
import userinfo from '../view/userinfo.vue'
import home from '../view/Home.vue'
import search from '../view/Search.vue'
import searchresult from '../view/SearchResult.vue'
import channel from '../view/Channel.vue'
import channelitem from '../view/ChannelItem.vue'
import video from '../view/Video.vue'

// import { component } from 'vue/types/umd'

Vue.use(VueRouter)
const routes=[
    {
        path:'/register',
        component:register
    },
    {
        path:'/login',
        component:login
    },
    {
        path:'/userinfo',
        component:userinfo
    },
    {
        path:'/search',
        component:search,
        children:[
            {
                path:'',
                component:searchresult
            }
        ]
    },
    {
        path:'/',
        component:home,
        children:[
            {
                path:'/channel/:id',
                component:channel,
                children:[
                    {
                        path:'/channel/:id/:rid',
                        component:channelitem,
                        name:'channelitem'
                    }
                ]
            },
        ]
    },
    {
        path:'/video/:bvid',
        component:video
    }
]

const router=new VueRouter({
    routes
})

export default router










